<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/Public/web/css/pintuer.css">
    <link rel="stylesheet" href="/Public/web/css/admin.css">
    <script src="/Public/web/js/jquery.js"></script>
    <script src="/Public/web/js/pintuer.js"></script>
    <script src="/Public/web/js/main.js"></script>
</head>

<script language="javascript" type="text/javascript" src="/Public/My97DatePicker/WdatePicker.js"></script>
<body>
<script>
    var ue = UE.getEditor('editor');
</script>
<div class="panel admin-panel">
  <!--<div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加内容</strong></div>-->
  <div class="body-content">
    <form method="post" class="form-x" action="?" enctype="multipart/form-data">
      <div class="form-group">
        <div class="label">
          <label>用户名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="<?php echo ($info['account_name']); ?>" name="account_name" data-validate="required:请输入用户名" />
          <div class="tips"></div>
        </div>
      </div>
        <div class="form-group">
            <div class="label">
                <label>密码：</label>
            </div>
            <div class="field">
                <input type="password" class="input w50" value="" name="password" />
                <div class="tips"></div>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>公司名称：</label>
            </div>
            <div class="field">
                <input type="text" class="input w50" value="<?php echo ($info['company_name']); ?>" name="company_name" data-validate="required:请输入公司名称!" />
                <div class="tips"></div>
            </div>
        </div>
         <div class="form-group">
          <div class="label">
            <label>logo：</label>
          </div>
          <div class="field">
            <input type="file" class="button bg-blue" name="company_logo" value="+ <?php echo L('liulanshangchuan');?>" onchange="preview(this)" style="float: left;">
            <div id="preview" name="img" style="float: left;width: 10%;box-sizing: border-box;" class="input" >
              <?php if(empty($info['company_logo'])): ?><img src="/Public/images/zanwu.jpg" width="100%" />
                <?php else: ?>
                <img src="/<?php echo ($info['company_logo']); ?>" width="100%" /><?php endif; ?>
            </div>
            <div class="tipss">推荐尺寸：100*100</div>
          </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>联系人：</label>
            </div>
            <div class="field">
                <input type="text" class="input w50" value="<?php echo ($info['full_name']); ?>" name="full_name" data-validate="required:请输入联系人名字!" />
                <div class="tips"></div>
            </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>手机号：</label>
            </div>
            <div class="field">
                <input type="text" class="input w50" value="<?php echo ($info['tel']); ?>" name="tel" data-validate="required:请输入电话号码!" />
                <div class="tips"></div>
            </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>套餐：</label>
          </div>
          <div class="field">
            <select name="role_id" class="input w50">
                <option value="0">请选择</option>
                <?php if(is_array($package)): foreach($package as $key=>$v): ?><option value="<?php echo ($v['role_id']); ?>" <?php if($v['role_id'] == $info['role_id']): ?>selected="selected"<?php endif; ?>><?php echo ($v['role_name']); ?></option><?php endforeach; endif; ?>
            </select>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
            <div class="label">
                <label>有效期</label>
            </div>
            <div class="field">
                <input class="Wdate input w50" type="text" name="expire_time" value="<?php echo (date("Y-m-d",$info['expire_time'])); ?>" onClick="WdatePicker()" />
            </div>
        </div>

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
    function preview(file)
    {
        var prevDiv = document.getElementById('preview');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" width="100%" />';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
</script>
</body>
</html>